<!DOCTYPE html>
<html lang="en">
 <head> 
  <meta charset="utf-8" /> 
  <title>${date}-广告接口文档</title> 
  <link href="../styles/css/style.css" rel="stylesheet" /> 
  <link href="../styles/css/jquery.nestable.css" rel="stylesheet" />
  <link href="../styles/css/style-responsive.css" rel="stylesheet" /> 
 </head> 
 <body class="sticky-header"> 
  <section> 
   <div class="left-side sticky-left-side"> 
    <div class="left-side-inner"> 
     <ul class="nav nav-pills nav-stacked custom-nav">
       <#list classifies as controller>
      <li class="menu-list"> <a href=""><i class="fa fa-file-text"></i> <span>${controller_index+1}.${controller.name}</span></a> 
       <ul class="sub-menu-list">
         <#list controller.docInterfaces as interface> 
        <li> 
         <!-- 跳转锚点 --> <a href="#${interface.url}" class="">${interface.letter})${interface.name}</a> </li> 
        </#list> 
       </ul> </li> 
      </#list> 
     </ul> 
    </div> 
   </div> 
   <div class="main-content"> 
    <!-- 接口类循环开始 --> <#list classifies as controller> 
    <div class="page-heading"> 
     <h3> 
      <!-- 接口类说明-->${controller_index+1}.${controller.name}(${controller.explain}) </h3> 
    </div> 
    <!-- 接口循环开始 --> <#list controller.docInterfaces as interface> 
    <!-- 锚点id --> 
    <div class="wrapper" id="${interface.url}"> 
     <ul class="breadcrumb" style="margin-bottom: 0px;"> 
      <li> 
       <!-- 接口说明-->${interface.letter})${interface.name} </li> 
      <li class="active"> 
       <!-- 接口备注-->${interface.explain} 
       <!-- 接口地址 --> <a>${interface.url}</a> </li> 
     </ul> 
     <div class="row"> 
      <div class="col-sm-7"> 
       <section class="panel"> 
        <header class="panel-heading">
          请求数据 
         <span class="tools pull-right"> <a href="javascript:;" class="fa fa-chevron-down"></a> </span> 
        </header> 
        <div class="panel-body"> 
         <table class="table"> 
          <thead> 
           <tr> 
            <th>字段</th> 
            <th>说明</th> 
            <th>类型</th> 
            <th>必填</th> 
           </tr> 
          </thead> 
          <tbody>
          <@requestTableTree children=interface.docRequestParameters />
          </tbody> 
         </table> 
         <div class="dd" > 
          <@requestJsonTree children=interface.docRequestParameters />
         </div> 
        </div> 
       </section> 
      </div> 
      <div class="col-sm-5"> 
       <section class="panel"> 
        <header class="panel-heading">
          返回数据 
         <span class="tools pull-right"> <a href="javascript:;" class="fa fa-chevron-down"></a> </span> 
        </header> 
        <div class="panel-body"> 
         <table class="table"> 
          <thead> 
           <tr> 
            <th>字段</th> 
            <th>说明</th> 
            <th>类型</th> 
           </tr> 
          </thead> 
          <tbody>
        	<@resultTableTree children=interface.docReturnParameters />
          </tbody> 
         </table> 
           <div class="dd"> 
          <@resultJsonTree children=interface.docReturnParameters />
         </div> 
        </div> 
       </section> 
      </div> 
     </div> 
    </div> 
    <!-- 接口循环结束 --> 
    </#list> 
    <footer style="background: #424f63;"> 
    </footer> 
    <!-- 接口类循环结束 --> 
    </#list> 
    <footer>
      2016 &copy; 接口文档 
     <a href="http://www.bjlianyao.com/" target="_blank">联耀科技</a> 
    </footer> 
   </div> 
  </section> 
  <script src="../styles/js/jquery-1.10.2.min.js"></script> 
  <script src="../styles/js/jquery-ui-1.9.2.custom.min.js"></script> 
  <script src="../styles/js/bootstrap.min.js"></script> 
  <script src="../styles/js/jquery.nicescroll.js"></script> 
  <script src="../styles/js/scripts.js"></script>  
 </body>
</html>

<#macro resultTableTree children>
    <#if children?? && children?size gt 0>
        <#list children as child>
            <tr> 
            <td>${child.name}</td> 
            <td>${child.explain}</td> 
            <td>${child.type}</td> 
           	</tr> 
            <@resultTableTree children=child.children />
        </#list>
    </#if>
</#macro>

<#macro resultJsonTree children>
	<#if children?? && children?size gt 0>
	<ol class="dd-list"> 
        <#list children as child>
           <li class="dd-item"><div class="dd-handle">${child.name}<div style="float: right;">${child.type}</div></div></li> 
            <@resultJsonTree children=child.children />
        </#list>
	</ol> 
	</#if>
</#macro>

<#macro requestTableTree children>
    <#if children?? && children?size gt 0>
        <#list children as child>
            <tr> 
            <td>${child.name}</td> 
            <td>${child.explain}</td> 
            <td>${child.type}</td> 
            <td>${child.required}</td> 
           	</tr> 
            <@requestTableTree children=child.children />
        </#list>
    </#if>
</#macro>

<#macro requestJsonTree children>
	<#if children?? && children?size gt 0>
	<ol class="dd-list"> 
        <#list children as child>
           <li class="dd-item"><div class="dd-handle">${child.name}<div style="float: right;">${child.type}</div></div></li> 
            <@requestJsonTree children=child.children />
        </#list>
	</ol> 
	</#if>
</#macro>
